// commons/diy/nav/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    nav_icon_list: {
      type:Array,
      value: null
    },
    setting: {
      type:Object,
      value: null
    },
    show_lable: {
      type: Number,
      value: 0
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  ready: function () {
    if (!this.properties.setting) {
      this.getDiyInfo();
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    navigatorClickBabber: function (t) {
      this.triggerEvent('navigatorClickBabber',t)
    },
    getDiyInfo: function () {
      var that = this;
      var shop = wx.getStorageSync('address_info');
      var shop_id = shop && shop.shop_id ? shop.shop_id : 0
      var item = {
        name: 'nav',
        shop_id: shop_id
      };
      getApp().request({
        url: getApp().api.index.get_diy_info,
        data: item,
        success: function(t) {
          that.setData({
            nav_icon_list : t.data.list
          })
        },
        complete: function() {
          
        }
      })
    },
  }
})
